﻿<%@ Page Language="C#" MasterPageFile="~/masterPage/admin/LoginReg.master" AutoEventWireup="true"
    CodeFile="regPurchases.aspx.cs" Inherits="Login_regPurchases" Title="采购商用户注册"
    MaintainScrollPositionOnPostback="true" %>

<%@ MasterType VirtualPath="../masterPage/admin/LoginReg.master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="SalePartial" TagName="ServiceReserved" Src="~/Controls/login/ServiceReserved.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../css/user.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function validatePhoto(source, arguments) {
                //arguments.IsValid = $find('<%= ruploadPhoto.ClientID %>').validateExtensions;
                arguments.IsValid = true;
            }

            function validateLogo(source, arguments) {
                //arguments.IsValid = $find('<%= ruploadLogo.ClientID %>').validateExtensions;
                arguments.IsValid = true;
            }

            function validateLicense(source, arguments) {
                arguments.IsValid = false;
                var upload = $find('<%= ruploadLicense.ClientID %>');

                if (upload == null) {
                    arguments.IsValid = true;
                    return;
                }

                var inputs = upload._uploadedFiles;
                for (var i = 0; i < inputs.length; i++) {
                    //check for empty string or invalid extension
                    if (inputs[i].value != "" ) {
                        arguments.IsValid = true;
                        break;
                    }
                }
            }
        </script>
        <script type="text/javascript">
            // <![CDATA[

            function validateCompanyProductUpload(source, e) {
                e.IsValid = false;

                var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);
                var inputs = upload._uploadedFiles;
                for (var i = 0; i < inputs.length; i++) {
                    //check for empty string or invalid extension
                    if (inputs[i].value != "") {
                        e.IsValid = true;
                        break;
                    }
                }
            }
                // ]]>
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgridCompanyCerts">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgridCompanyCerts" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

      <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

    <telerik:RadInputManager ID="RadInputManager1" runat="server">
        <telerik:TextBoxSetting BehaviorID="TextBoxBehavior16" ErrorMessage="请描述一下您的企业状况"
            EmptyMessage="描述一下您的企业吧..." FocusedCssClass="inp ipt-focus">
            <TargetControls>
                <telerik:TargetInput ControlID="tbDescription" />
            </TargetControls>
            <Validation IsRequired="true" ValidationGroup="submitbasic" />
        </telerik:TextBoxSetting>
        <telerik:RegExpTextBoxSetting BehaviorID="RagExpBehavior17" ValidationExpression="[0-9]{15}"
            EmptyMessage="请填写营业执照号码" FocusedCssClass="inp ipt-focus" ErrorMessage="请填写您企业的营业执照号码(15位)">
            <TargetControls>
                <telerik:TargetInput ControlID="tbLicense" />
            </TargetControls>
            <Validation IsRequired="true" ValidationGroup="submitbasic" />
        </telerik:RegExpTextBoxSetting>
    </telerik:RadInputManager>

    <asp:HiddenField ID="hfRegedUsername" runat="server" />
    <div class="main-cont-tit">
        <div class="arr">
        </div>
        <h2>
            填写采购商企业信息</h2>
        <span class="fle Cgray">（请填写采购商企业信息）</span></div>
    <table class="cont-tab" cellspacing="0" cellpadding="0">
        <tr>
            <td class="td1">
                企业名称:<span class="prompt">*</span>
            </td>
            <td class="td2">
                <asp:TextBox ID="tbCompanyName" runat="server" CssClass="inp ipt-normal" Width="120"
                    MaxLength="30"></asp:TextBox>
            </td>
            <td class="td3">
            </td>
        </tr>
        <tr>
            <td class="td1">
                行业类别:<span class="prompt">*</span>
            </td>
            <td class="td2">
                <telerik:RadComboBox ID="rcbIndustry" runat="server" AllowCustomText="false">
                    <Items>
                        <telerik:RadComboBoxItem Text="制造业" />
                        <telerik:RadComboBoxItem Text="电力行业" />
                        <telerik:RadComboBoxItem Text="仪器仪表" />
                    </Items>
                </telerik:RadComboBox>
            </td>
            <td class="td3">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ValidationGroup="submitbasic"
                    ControlToValidate="rcbIndustry" ErrorMessage="请选择您公司所从事的行业"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="td1">
                企业网址:&nbsp;
            </td>
            <td class="td2">
                <telerik:RadTextBox ID="rtbWebsite" runat="server" CssClass="inp ipt-normal" FocusedStyle-CssClass="inp ipt-focus"
                    MaxLength="20">
                </telerik:RadTextBox>
            </td>
            <td class="td3">
            </td>
        </tr>
        <tr>
            <td class="td1">
                注册资金:&nbsp;
            </td>
            <td class="td2">
                <telerik:RadNumericTextBox ID="rntbFund" runat="server" Culture="zh-CN" Type="Currency"
                    CssClass="inp ipt-normal" FocusedStyle-CssClass="inp ipt-focus" MaxValue="9999999999">
                    <NumberFormat KeepNotRoundedValue="true" DecimalDigits="2" />
                </telerik:RadNumericTextBox>
            </td>
            <td class="td3">
            </td>
        </tr>
    </table>
    <table class="cont-tab" cellspacing="0" cellpadding="0">
        <tr>
            <td class="td1">
                <span class="prompt">*</span>职 位:
            </td>
            <td class="td2">
                <telerik:RadComboBox ID="rcbJobtitle" runat="server" AllowCustomText="false" AutoPostBack="false"
                    EmptyMessage="请选择您在公司的职位" ErrorMessage="请选择正确的职位">
                    <Items>
                        <telerik:RadComboBoxItem Text="首席执行官/总裁/总经理" />
                        <telerik:RadComboBoxItem Text="副总裁/副总经理" />
                        <telerik:RadComboBoxItem Text="行政总监" />
                        <telerik:RadComboBoxItem Text="办事处首席代表" />
                        <telerik:RadComboBoxItem Text="分公司/分支机构/办事处经理" />
                        <telerik:RadComboBoxItem Text="总裁助理/总经理助理" />
                        <telerik:RadComboBoxItem Text="技术研发经理/主管" />
                        <telerik:RadComboBoxItem Text="质量管理总监/主管" />
                        <telerik:RadComboBoxItem Text="营运主管/经理" />
                        <telerik:RadComboBoxItem Text="生产总监/经理/主管" />
                        <telerik:RadComboBoxItem Text="采购总监/经理/主管" />
                        <telerik:RadComboBoxItem Text="物流总监/经理/主管" />
                        <telerik:RadComboBoxItem Text="总工程师/副总工程师" />
                        <telerik:RadComboBoxItem Text="销售总监/经理/主管" />
                        <telerik:RadComboBoxItem Text="技术工程师" />
                        <telerik:RadComboBoxItem Text="销售专员" />
                        <telerik:RadComboBoxItem Text="采购专员" />
                        <telerik:RadComboBoxItem Text="质量管理工程师" />
                        <telerik:RadComboBoxItem Text="贸易专员" />
                    </Items>
                </telerik:RadComboBox>
            </td>
            <td class="td3">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="submitbasic"
                    ControlToValidate="rcbJobtitle" ErrorMessage="请选择您在公司的职位"></asp:RequiredFieldValidator>
            </td>
        </tr>
    </table>
    <table class="cont-tab" cellspacing="0" cellpadding="0">
        <tr>
            <td class="td1">
                <span class="prompt">*</span>联系电话:
            </td>
            <td class="td2">
                <asp:TextBox ID="tbPhone" runat="server" CssClass="inp ipt-normal" Width="120"></asp:TextBox>
            </td>
            <td class="td3">
                <asp:CheckBox ID="cbPhone" runat="server" Text="对供应商公开" Checked="true" TextAlign="Right" />
            </td>
        </tr>
        <tr>
            <td class="td1">
                手机:&nbsp;
            </td>
            <td class="td2">
                <asp:TextBox ID="tbCellphone" runat="server" CssClass="inp ipt-normal" Width="120"></asp:TextBox>
            </td>
            <td class="td3">
                <asp:CheckBox ID="cbCellphone" runat="server" Text="对供应商公开" TextAlign="Right" />
            </td>
        </tr>
        <tr>
            <td class="td1">
                传真号码:&nbsp;
            </td>
            <td class="td2">
                <asp:TextBox ID="tbFax" runat="server" CssClass="inp ipt-normal" Width="120"></asp:TextBox>
            </td>
            <td class="td3">
                <asp:CheckBox ID="cbFax" runat="server" Text="对供应商公开" TextAlign="Right" />
            </td>
        </tr>
    </table>
    <table class="cont-tab" cellspacing="0" cellpadding="0">
        <tr>
            <td class="td1">
                <span class="prompt">*</span>首选结算货币:&nbsp;&nbsp;
            </td>
            <td class="td2">
                <telerik:RadComboBox ID="rcbCurrency" runat="server" AllowCustomText="false" DataSourceID="xdsCurrency"
                    DataTextField="Name" DataValueField="Value">
                </telerik:RadComboBox>
            </td>
            <td class="td3">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" ControlToValidate="rcbCurrency"
                    runat="server" ErrorMessage="请选择您公司首选货币" ValidationGroup="submitbasic"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="td1">
                <span class="prompt">*</span>企业规模:
            </td>
            <td class="td2" colspan="2" style="text-align: left;">
                <asp:RadioButtonList ID="rblFirmSize" runat="server" RepeatDirection="Horizontal"
                    Width="420px">
                    <asp:ListItem Text="< 10人" Value="XS" Selected="True"></asp:ListItem>
                    <asp:ListItem Text="10-50人" Value="S"></asp:ListItem>
                    <asp:ListItem Text="51-100人" Value="M"></asp:ListItem>
                    <asp:ListItem Text="101-500人" Value="L"></asp:ListItem>
                    <asp:ListItem Text="> 500人" Value="XL"></asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td class="td1">
                <span class="prompt">*</span>企业描述(500字以内):&nbsp;&nbsp;
            </td>
            <td class="td2" style="text-align: left;">
                <asp:TextBox ID="tbDescription" runat="server" CssClass="inp ipt-normal" TextMode="MultiLine"
                    MaxLength="500" Width="400px" Height="100px"></asp:TextBox>
            </td>
        </tr>
    </table>
    <div class="main-cont-tit">
        <div class="arr">
        </div>
        <h2>
            采购商图片</h2>
        <span class="fle Cgray">（请上传采购商图片）</span></div>
    <table class="upTable" cellspacing="0" cellpadding="0">
        <tr>
            <td class="upTd">
                注册人照片
            </td>
            <td class="upTd">
                企业LOGO
            </td>
        </tr>
        <tr>
            <td class="upTd">
                <asp:Image ID="imgPhoto" CssClass="upImg" runat="server" ImageUrl="~/images/logon/blank_photo.jpeg" />
            </td>
            <td class="upTd">
                <asp:Image ID="imgLogo" CssClass="upImg" runat="server" ImageUrl="~/images/logon/blank_logo.jpeg" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                建议上传图片为160像素*120像素或者文件大小在1024KB以内<br />
            </td>
        </tr>
        <tr>
            <td>
                <asp:CustomValidator ID="Customvalidator1" runat="server" Display="Dynamic" ClientValidationFunction="validatePhoto"
                    ErrorMessage="照片文件格式错误" ValidationGroup="photoupload" />
            </td>
            <td>
                <asp:CustomValidator ID="Customvalidator2" runat="server" Display="Dynamic" ClientValidationFunction="validateLogo"
                    ErrorMessage="Logo文件格式错误" ValidationGroup="logoupload" />
            </td>
        </tr>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
        <tr>
            <td class="upTd">
                <telerik:RadAsyncUpload ID="ruploadPhoto" runat="server" ControlObjectsVisibility="None"
                    InputSize="20" MaxFileInputsCount="1" MaxFileSize="1024000" ReadOnlyFileInputs="true"
                    Width="200" OverwriteExistingFiles="true" TargetFolder="~/images/svImg" AllowedFileExtensions=".jpg,.jpeg,.bmp,.gif,.png">
                    <Localization Select="选择" />
                </telerik:RadAsyncUpload>
            </td>
            <td class="upTd">
                <telerik:RadAsyncUpload ID="ruploadLogo" runat="server" ControlObjectsVisibility="None"
                    InputSize="20" MaxFileInputsCount="1" MaxFileSize="1024000" ReadOnlyFileInputs="true"
                    Width="200" OverwriteExistingFiles="true" TargetFolder="~/images/svImg" AllowedFileExtensions=".jpg,.jpeg,.bmp,.gif,.png"
                    OnClientFileSelected="">
                    <Localization Select="选择" />
                </telerik:RadAsyncUpload>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btnUploadPhoto" runat="server" ValidationGroup="photoupload" Text="上传照片"
                    OnClick="btnUploadPhoto_Click" />
                <asp:Button ID="btnDeletePhoto" runat="server" Visible="false" CausesValidation="false"
                    Text="删除照片" OnClick="btnDeletePhoto_Click" />
            </td>
            <td>
                <asp:Button ID="btnUploadLogo" runat="server" ValidationGroup="logoupload" Text="上传Logo"
                    OnClick="btnUploadLogo_Click" />
                <asp:Button ID="btnDeleteLogo" runat="server" Visible="false" CausesValidation="false"
                    Text="删除Logo" OnClick="btnDeleteLogo_Click" />
            </td>
        </tr>
        </telerik:RadAjaxPanel>
    </table>
    <div class="main-cont-tit">
        <div class="arr">
        </div>
        <h2>
            证书与资质</h2>
        <span class="fle Cgray">（请确认个人信息是否正确）</span></div>
    <table class="cont-tab" cellspacing="0" cellpadding="0" style="table-layout: fixed">
        <tr>
            <td class="td1">
                <span class="prompt">*</span>营业执照号码:&nbsp;&nbsp;
            </td>
            <td class="td2">
                <asp:TextBox ID="tbLicense" runat="server" CssClass="inp ipt-normal" Width="200"></asp:TextBox>
            </td>
            <td class="td3">
            </td>
        </tr>
        <tr>
        <telerik:RadAjaxPanel ID="RadAjaxPanel3" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <td class="td1">
                <span class="prompt">*</span>营业执照扫描件:&nbsp;&nbsp;
            </td>
            <td class="td2">
                <telerik:RadAsyncUpload ID="ruploadLicense" runat="server" ControlObjectsVisibility="None"
                    InputSize="20" MaxFileInputsCount="1" MaxFileSize="5120000" ReadOnlyFileInputs="true"
                    Width="200" OverwriteExistingFiles="true" TargetFolder="~/images/svImg" AllowedFileExtensions=".pdf,.jpg,.jpeg,.bmp,.gif,.tif,.xps">
                    <Localization Select="选择" />
                </telerik:RadAsyncUpload>
                <asp:HyperLink ID="lnkLicense" Target="_blank" Visible="false" runat="server" />
            </td>
            <td class="td3">
                <asp:CustomValidator ID="Customvalidator4" runat="server" Display="Dynamic" ClientValidationFunction="validateLicense"
                    ErrorMessage="文件格式错误" ValidationGroup="submitbasic" />
                <asp:Button ID="btnUploadLicense" runat="server" ValidationGroup="licenseupload"
                    Text="上传营业执照" OnClick="btnUploadLicense_Click" />
                <asp:Button ID="btnDeleteLicense" runat="server" Visible="false" CausesValidation="false"
                    Text="删除营业执照" OnClick="btnDeleteLicense_Click" />
            </td>
            </telerik:RadAjaxPanel>
        </tr>
        <tr>
            <td align="center">
                <telerik:RadGrid runat="server" ID="rgridCompanyCerts" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" Width="500" ShowStatusBar="True" GridLines="None"
                    PageSize="5" OnDeleteCommand="rgridCompanyCerts_DeleteCommand" OnInsertCommand="rgridCompanyCerts_InsertCommand"
                    OnItemCommand="rgridCompanyCerts_ItemCommand">
                    <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
                    <MasterTableView CommandItemDisplay="Top" DataKeyNames="CertID" EditMode="PopUp">
                        <NoRecordsTemplate>
                            <span class="prompt">*</span><font color="red">您还未添加任何资质认证哦...</font></NoRecordsTemplate>
                        <CommandItemSettings AddNewRecordText="添加认证" ShowRefreshButton="false" ShowAddNewRecordButton="true">
                        </CommandItemSettings>
                        <Columns>
                            <telerik:GridDropDownColumn DataSourceID="xdsCertClass" ListTextField="Name" ListValueField="Value"
                                UniqueName="CertName" SortExpression="CertName" HeaderText="认证名称" DataField="CertName"
                                DropDownControlType="RadComboBox">
                            </telerik:GridDropDownColumn>
                            <telerik:GridTemplateColumn HeaderText="资质证书扫描件" UniqueName="CertFileName" DataField="CertFileName">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtDownloadFile" CommandName="DownloadCert" runat="server" Text='<%# Eval("CertFileName") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadAsyncUpload ID="radUploadCert" runat="server" MaxFileInputsCount="1"
                                        Width="300" ControlObjectsVisibility="None" MaxFileSize="2048000" TargetFolder="temp"
                                        ReadOnlyFileInputs="true" AllowedFileExtensions=".pdf,.jpg,.jpeg,.bmp,.gif,.tif,.xps"
                                        OverwriteExistingFiles="true">
                                        <Localization Select="选择文件" />
                                    </telerik:RadAsyncUpload>
                                    建议图片格式为pdf/jpg/gif/xps/tif且文件大小不超过2MB
                                    <asp:CustomValidator ID="cvalidatorUploadcert" runat="server" Display="Dynamic" ErrorMessage="请上传认证文件"
                                        ClientValidationFunction="validateCompanyProductUpload" ValidationGroup="validateCompanyCert" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridButtonColumn Text="删除" CommandName="Delete" ButtonType="ImageButton">
                                <HeaderStyle Width="2%" />
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn ButtonType="ImageButton" CancelText="取消" InsertText="新建" />
                        </EditFormSettings>
                        <PagerStyle AlwaysVisible="False"></PagerStyle>
                    </MasterTableView>
                    <ValidationSettings ValidationGroup="validateCompanyCert" />
                </telerik:RadGrid>
            </td>
        </tr>
    </table>
    <table class="cont-tab" cellspacing="0" cellpadding="0" style="table-layout: fixed">
        <tr>
            <td class="td1">
                &nbsp;
            </td>
            <td class="td2 codeImg">
                <telerik:RadCaptcha ID="RadCaptchaReg" runat="server" ErrorMessage="您输入的字符不正确" CaptchaLinkButtonText="看不清？换一张"
                    EnableRefreshImage="true" CaptchaTextBoxLabel="请输入上边的字符" CaptchaTextBoxCssClass="inp ipt-normal">
                    <CaptchaImage BackgroundNoise="High" LineNoise="High" FontWarp="High" TextLength="5"
                        TextColor="Gray" BackgroundColor="White" />
                </telerik:RadCaptcha>
            </td>
            <td class="td3">
                &nbsp;
            </td>
        </tr>
    </table>
    <div class="main-cont-tit">
        <div class="arr">
        </div>
        <h2>
            服务条款</h2>
    </div>
    <SalePartial:ServiceReserved ID="serviceReserved" runat="server" />
    <table class="cont-tab" cellspacing="0" cellpadding="0" style="table-layout: fixed">
        <tr>
            <td class="td3">
                <asp:ImageButton ID="ibtSupply" name="" runat="server" CssClass="btn-submit" ImageUrl="../images/backImg/ImageButtonBack.png"
                    OnClick="ibtBack_Click" ToolTip="返回 " />
            </td>
            <td class="td3">
                <asp:ImageButton ID="ImageButton2" name="" runat="server" CssClass="btn-submit" ValidationGroup="submitbasic"
                    ImageUrl="../images/backImg/ImageButton1.png" OnClick="ibtSubmit_Click" ToolTip="完成注册 终于要完成注册了 " />
            </td>
        </tr>
    </table>
    <asp:XmlDataSource ID="xdsCurrency" runat="server" DataFile="~/App_Data/XML/Currency.xml">
    </asp:XmlDataSource>
    <asp:XmlDataSource ID="xdsCertClass" runat="server" DataFile="~/App_Data/XML/CertificationClass.xml">
    </asp:XmlDataSource>
</asp:Content>
